﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DeveloperSite.Master" AutoEventWireup="true" 
    CodeBehind="Output_List.aspx.cs" Inherits="Amkeni_System.CO.Output_List" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
        ConnectionString="name=Amkeni_DatabaseEntities" DefaultContainerName="Amkeni_DatabaseEntities" 
        EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
        EnableUpdate="True" EntitySetName="programme_output">
    </asp:EntityDataSource>

    <div style="height:2em;">
        <div style="float:left;">
            <asp:Label ID="ContextLabel" runat="server" Text="PROGRAMME OUTPUT" CssClass="ContentHead"></asp:Label>
        </div>
        <% if (User.IsInRole("Administrator"))
           { %>
            <div style="float:right;">
                <asp:Button ID="AddOutputButton" runat="server" Text="Add New Programme Output" OnClick="AddOutputButton_Click" />
            </div>
        <% } %>
    </div>

    <% if (User.IsInRole("Administrator"))
       { %>
        <asp:GridView ID="GridView1" runat="server" DataKeyNames="output_id" 
            DataSourceID="EntityDataSource1" CssClass="NewGrid" ShowFooter="True" 
            AllowSorting="True" AutoGenerateColumns="False">
            <AlternatingRowStyle CssClass="NewGridAlt" />
            <Columns>
                <asp:BoundField DataField="output_id" HeaderText="OUTPUT ID" 
                    SortExpression="output_id" ReadOnly="true" 
                    HeaderStyle-ForeColor="White" >
<HeaderStyle ForeColor="White"></HeaderStyle>
                </asp:BoundField>
                <asp:BoundField DataField="name" HeaderText="OUTPUT" SortExpression="name" />
                <asp:CommandField ShowEditButton="true" ButtonType="Button" HeaderText="EDIT" />
                <asp:CommandField ShowDeleteButton="true" ButtonType="Button" HeaderText="DELETE" />
            </Columns>
            <FooterStyle CssClass="NewGridFooter" />
        </asp:GridView>
    <% }
       else
       { %>
       <asp:GridView ID="GridView2" runat="server" DataKeyNames="output_id" 
        DataSourceID="EntityDataSource1" CssClass="NewGrid" ShowFooter="True" 
        AllowSorting="True" AutoGenerateColumns="False">
        <AlternatingRowStyle CssClass="NewGridAlt" />
        <Columns>
            <asp:BoundField DataField="output_id" HeaderText="OUTPUT ID" 
                SortExpression="output_id" ReadOnly="true" 
                HeaderStyle-ForeColor="White" >
            </asp:BoundField>
            <asp:BoundField DataField="name" HeaderText="OUTPUT" SortExpression="name" />
        </Columns>
        <FooterStyle CssClass="NewGridFooter" />
    </asp:GridView>
    <% } %>
</asp:Content>
